$(function(){
	$('#loginBtn').on('click',function(){
		var username = $('[name="username"]').val();
		var password = $('[name="password"]').val();
		if(!username){
            mui.toast("请输入正确的用户名");           
        } 
        if(!password){
            mui.toast("请输入正确的密码");           
        }
        $.ajax({
        	url:'/user/login',
        	type:'post',
        	data:{
        		username : username,
        		password : password
        	},
        	success:function(res){
        		if(res.success){
        			mui.toast("登录成功");
        			location.href='user.html';
        		}
        		
        	}
        });
	});
});
